package com.luke.dubbo.order.service.impl.event;

import com.luke.dubbo.api.bean.Person;

import java.util.HashMap;
import java.util.Map;

/**
 * @Descrtption NotifyImpl
 * @Author luke
 * @Date 2020/4/1
 **/
public class NotifyImpl implements Notify{

    public Map<Integer, Person> ret    = new HashMap<Integer, Person>();

    public Map<Integer, Throwable> errors = new HashMap<Integer, Throwable>();

    @Override
    public void oninvoke(Integer id) {
        System.out.println("oninvoke:" + id);
    }

    @Override
    public void onreturn(Person msg,Integer id) {
        System.out.println("onreturn:" + msg);
        ret.put(id, msg);
    }

    @Override
    public void onthrow(Throwable ex, Integer id) {
        errors.put(id, ex);
    }

}
